/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.res0w.SMMS.ui.UDResource;

import javax.swing.JPanel;
import javax.swing.JWindow;

/**
 *
 * @author res0w
 * @since 2009-9-24
 * @version 0.5
 */
public abstract class ListMenuWindow extends JWindow {

    public ImagePanel panel;

//    public int no;
    //创建抽象方法
    public abstract void btnInit();

    public ListMenuWindow(JPanel parentPanel) {
        String imageUrl = "/com/res0w/SMMS/ui/UDResource/listMenu.png";
        panel = new ImagePanel(imageUrl);
        btnInit();//调用button生成方法；
        this.setContentPane(panel);
    /*
    ImageButton btn1 = new ImageButton(
    "/com/res0w/SMMS/ui/UDResource/rollcall_d.png",
    "/com/res0w/SMMS/ui/UDResource/rollcall_h.png",
    "/com/res0w/SMMS/ui/UDResource/rollcall_p.png");
    ImageButton btn2 = new ImageButton(
    "/com/res0w/SMMS/ui/UDResource/rollcall_d.png",
    "/com/res0w/SMMS/ui/UDResource/rollcall_h.png",
    "/com/res0w/SMMS/ui/UDResource/rollcall_p.png");
    panel.setButtonLocation(btn1, 0, 6);
    panel.setButtonLocation(btn2, 0, 42);



    btn1.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent e) {
    //                System.out.println("tn1Stroke");
    no=1;
    setVisible(false);

    }
    });

    btn2.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent e) {
    no = 2;
    setVisible(false);
    }
    });
     */
    }
    /*
     *测试方法
     */

    public static void main(String[] args) {
        ListMenuWindow f = new ListMenuWindow(new JPanel()) {

            @Override
            public void btnInit() {
//                throw new UnsupportedOperationException("Not supported yet.");
            }
        };
        //    f.setLocationRelativeTo(null);
        f.setVisible(true);
        f.pack();
    }
}